• Page:
  • 1
  • 2

TOPIC: Command Line Replacements

Re:Command Line Replacements 05 Dec 2008 08:13 #335

  • perherman
  • perherman's Avatar
what is the complete syntax for command line replacements.

We have an application that utilises CR 8, with our own .dll that sends parameters to the reports. We would like to use CR 2008, but need quite sophisticated parameters (dates, numerics, alpha, range of values, appending to the sql, etc

PerOlof Hermansson

This email address is being protected from spambots. You need JavaScript enabled to view it.
The administrator has disabled public write access.

Re:Command Line Replacements 05 Dec 2008 12:17 #336

  • aellis
  • aellis's Avatar
Just to be sure we are on the same page here - command line replacements is a Logicity-only feature and doesn't exist in Crystal Report 2008 by itself. It is a custom bit of code we wrote that allows command line arguments to fill in parameters in your Logicity Solution File. Also, it is only present in Logicity Pro.

That said, the syntax for command line replacements is simply what is displayed in the first post - you simply make up a variable name enclosed in percent signs anywhere within Logicity Solution Builder. So if you wanted to do a date range, for example, you might set the beginning of the date range to %BEGIN% and the ending to %END%. Now when you execute this Logicity Solution File you will need to provide a command line argument defining the value for each of these variables you've defined. Where I think Logicity may fall short based on your post would be appending to SQL...we don't currently have any facility to handle that.

Hope this helps,
Adam
The administrator has disabled public write access.

Re:Command Line Replacements 06 Dec 2008 17:53 #337

  • perherman
  • perherman's Avatar
Hi,

I just bought Logicity, and received the licenscode, and registered it.

I like what I see so far, but I cannot find anything about command line replacements (to send parameters to the report) anywhere in the manual that I downloaded.

Is there any more that what you have posted in this Tips and Tricks-thread?

Thanks,


Per-Olof
The administrator has disabled public write access.

Re:Command Line Replacements 08 Dec 2008 13:11 #338

  • aellis
  • aellis's Avatar
Unfortunately the only documentation for this feature exists on this post currently. We'll work on that, but in the meantime is there anything I can clear up for you on how to make use of the feature?
The administrator has disabled public write access.

Re:Command Line Replacements 08 Dec 2008 13:55 #339

  • perherman
  • perherman's Avatar
We currently use command line parameters to CR 8.5 frequently, so here are a few examples of what we send to our current bridge .dll:

We always send the following basics:
c:\mrptlink.exe report.rpt db_user dp_password

then comes parameters,

one parameter:
BatchNumber (numeric)
SubscriptionCOde (Alpha)
DUeDate (Date)
ActiveMembers: Logical (= 1 or O, numeric?)

two parameters:
SubscriptionCode + SegmentCode

Range of:
BatchNumberFrom BatchNumberTo (numeric)
CreatedDateFrom CreatedDateTo (Date)

When it comes to dates we send them as strings: 'YYYY-MM-DD'

My question is if any of these combinations above need any special consideration?

Otherwise I will start testing, and come back to you with feed-back.

Per-Olof
The administrator has disabled public write access.

Re:Command Line Replacements 08 Dec 2008 14:28 #340

  • perherman
  • perherman's Avatar
First trial:

I enter the following at the command prompt:

"c:\Program Files\Saberlogic\Logicity\Logicity Desktop.exe" "C:\aquila\reports\prislista.rpt" pCOMPANY='Mass Marketing Software AB' pUSER='Per-Olof Hermansson' pCMM_CODE='KOD'

I have tried to replace ' with " or not use any string delimiters, but the result is the same I get a screen asking me to fill out the parameter values.

How do I send the string parameters, I assume that the numeric parameters are sent without any delimiter.

I also get a screen asking for the password (The schema user is saved by default in the report).

Is it possible to sent the password as a parameter?

Per-Olof
The administrator has disabled public write access.

Re:Command Line Replacements 08 Dec 2008 15:34 #341

  • perherman
  • perherman's Avatar
I realise now that I should call for a .RDD file.

However, when I do this with parameters it still runs the report with the parameters that I defined the RDD with.

This when I call the following in the command prompt:


"c:\Program Files\Saberlogic\Logicity\Logicity Desktop.exe" "C:\aquila\reports\prislista.rdd" pCOMPANY='Mass Marketing Software AB' pUSER='Per-Olof Hermansson' pCMM_CODE='KOD2'

I get the report with "MMS AB" (as Company), and "Server" (as user), and with the range on "KOD" rather than "KOD2", i.e. it runs as I defined it in the .rdd.

Somehow the parameters that I add to the command do not change the runtime range of data.

Per-Olof
The administrator has disabled public write access.

Re:Command Line Replacements 08 Dec 2008 20:30 #342

  • aellis
  • aellis's Avatar
Per-Olof,

A couple of things to check here - first off I think you want to use double quotes instead of single quotes around your variable definitions to correctly handle spaces. Next, and this isn't documented anywhere, in order to specify multiple variables you need to separate the string with semi-colons. So here is what your resulting command line would look like:

"c:\Program Files\Saberlogic\Logicity\Logicity Desktop.exe" "C:\aquila\reports\prislista.rdd" pCOMPANY="Mass Marketing Software AB";pUSER="Per-Olof Hermansson";pCMM_CODE="KOD2"

Then you will have all of the following variables available to you within Logicity Solution Builder:

%pCOMPANY%
%pUSER%
%pCMM_CODE%

Let me know how you make out,
Adam
The administrator has disabled public write access.

Re:Command Line Replacements 09 Dec 2008 13:35 #343

  • perherman
  • perherman's Avatar
Very strange: Today when I try, nothing works.

I can call "c:\Program Files\Saberlogic\Logicity\Logicity Desktop.exe" and it will ask me to open a file.

But when I put: "c:\Program Files\Saberlogic\Logicity\Logicity Desktop.exe" "C:\aquila\reports\AQUILA.rdd" pCOMPANY="Mass Marketing Software AB";pUSER="Per-Olof Hermansson";pCMM_CODE="KOD2"

nothing happens, and whatever I do, change parameters, or even try to run the report without parameters, id does not call or open a program.


Per-Olof
The administrator has disabled public write access.

Re:Command Line Replacements 09 Dec 2008 14:05 #345

  • bellis
  • bellis's Avatar
Did you test the RRD file before trying to pass it via that command line? Could you attach your RRD file? Make sure you edit it in notepad first and change the password (if you have it defined) to something like SOMEPASS.

Thanks!
Brian
The administrator has disabled public write access.
  • Page:
  • 1
  • 2